package ReviewTest;

import java.util.ArrayList;


public class demo05 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("SKASSsda");
        list.add("1111");
        list.add("asdasdasd");
//        char[] arr = list.get(0).toCharArray();
//        for (int i = 0; i < arr.length; i++) {
//            System.out.println(arr[i]);
//        }
        int[] brr = getCount(list);
        System.out.println("数字个数为" + brr[0]);
        System.out.println("小写个数为" + brr[1]);
        System.out.println("大写个数为" + brr[2]);
    }


    public static int[] getCount(ArrayList<String> list) {
        int countDaxie = 0;
        int countXiaoxie = 0;
        int countShuzi = 0;

        for (int i = 0; i < list.size(); i++) {
            char[] s = list.get(i).toCharArray();
            for (int i1 = 0; i1 < s.length; i1++) {
                if (s[i1] >= 'a' && s[i1] <= 'z') {
                    countXiaoxie++;
                }
                if (s[i1] >= 'A' && s[i1] <= 'Z') {
                    countDaxie++;
                }
                if (s[i1] >= '0' && s[i1] <= '9') {
                    countShuzi++;
                }
            }
        }
        int[] arr = new int[3];
        arr[0] = countShuzi;
        arr[1] = countXiaoxie;
        arr[2] = countDaxie;
        return arr;
    }
}
